/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-03-21 18:49:35
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2024-03-21 22:22:49
 * @FilePath: \project-my\mytestApp\src\common\hoc\floatButton.tsx
 * @Description: 
 */
import React from 'react'
import { View, StyleSheet } from 'react-native';
type IReactComponent = React.ComponentClass | React.ClassicComponentClass | React.FunctionComponent | React.ForwardRefExoticComponent<any>;

export default function floatButton<T extends IReactComponent>(OriginView: T): T {
    const hocView = (props: any) => {
        return (
            <>
                {/* 类似于slot作用 */}
                <OriginView {...props} />
                <View>我是悬浮按钮</View>
            </>
        )
    }

    return hocView as T;
}

const styles = StyleSheet.create({
    container: {
        position: 'absolute',
        bottom: 0,
        right: 0,
        width: 100,
        height: 100,
        backgroundColor: 'red'
    }
})

